<%@ page language="java" import="java.util.*,com.beans.*,com.dao.*"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title></title>
<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="js/jquery.easing.js"></script>
<script type="text/javascript" src="js/jquery.accordion.js"></script>

<script type="text/javascript">
	$(function() {

		$('#navigation').accordion({
			active : 1, /* 第三个被激活 */
			header : '.head',
			/*navigation1: false,  */
			event : 'click',
			fillSpace : true,
			animated : 'bounceslide' /*slide,bounceslide ,bounceslide,easeslide'*/
		});

	});
</script>
<link rel="stylesheet" type="text/css" href="css/menu.css">

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">


<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>

	<%
		MenuDao dao = new MenuDao();
		Integer roleId=((AdminInfo) session.getAttribute("session_admin")).getRoleId();
		if(roleId!=null){
			List<MenuInfo> menuList = dao.getMenuList(0,roleId); //0表示它是一级菜单
			request.setAttribute("menuList", menuList);
		}
		else{
			List<MenuInfo> menuList=null;
			request.setAttribute("menuList", menuList);
		}
	%>
	<ul id="navigation">
		<c:forEach var="m" items="${menuList}">
			<c:if test="${m.parentId==0}">
				<li><a class="head">${m.menuName}</a>
					<ul>
						<li><c:forEach var="m_sub" items="${m.menuList }">
								<a href="${ m_sub.url}" target="${m_sub.target }"><img
									src="images/${m_sub.icon }" /><label>${m_sub.menuName }</label></a>
							</c:forEach></li>
					</ul></li>

			</c:if>
		</c:forEach>
	</ul>
</body>
</html>